<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateRegionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('regions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name',20)->comment('名称');
            $table->integer('parent_id')->default(0)->comment('上级ID');
            $table->string('map')->nullable()->comment('位置');
            $table->string('longitude')->nullable()->comment('经度');
            $table->string('latitude')->nullable()->comment('纬度');
            $table->string('domain')->nullable()->comment('子域名');
            $table->string('alias')->nullable()->comment('别名');
            $table->string('is_hot')->default('F')->nullable()->comment('是否热门 T 是 F 否');
            $table->string('letter')->nullable()->comment('大写首字母');
            $table->string('seo_title')->nullable()->comment('seo标题');
            $table->string('seo_keywords')->nullable()->comment('seo关键词');
            $table->string('seo_description')->nullable()->comment('seo描述');
            $table->integer('level')->default(0)->nullable()->comment('层级');
            $table->integer('sort')->default(0)->comment('排序');
            $table->string('status')->default('T')->comment('状态：T 正常 F 禁用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('regions');
    }
}
